package com.zhonghui.modlules.cart.eshopDomain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;

@TableName("store_bargain")
public class StoreBargain extends BaseDomain {
    @TableId
    @ApiModelProperty("砍价产品ID")
    private Long id;
    @ApiModelProperty("关联产品ID")
    private Long productId;
    @NotBlank(
            message = "请填写砍价名称"
    )
    @ApiModelProperty("砍价产品名称")
    private String title;
    @NotBlank(
            message = "请上传商品图片"
    )
    @ApiModelProperty("砍价产品图片")
    private String image;
    @ApiModelProperty("砍价产品单位名称")
    private String unitName;
    @NotNull(
            message = "请输入库存"
    )
    @Min(
            message = "库存不能小于0",
            value = 1L
    )
    @ApiModelProperty("砍价产品库存")
    private Integer stock;
    @ApiModelProperty("砍价产品销量")
    private Integer sales;
    @NotBlank(
            message = "请上传商品轮播图"
    )
    @ApiModelProperty("砍价产品轮播图")
    private String images;
    @NotNull(
            message = "请选择开始时间"
    )
    @ApiModelProperty("砍价产品开始时间")
    private Date startTime;
    @NotNull(
            message = "请选择结束时间"
    )
    @ApiModelProperty("砍价产品结束时间")
    private Date stopTime;
    @ApiModelProperty("砍价产品名称")
    private String storeName;
    @NotNull(
            message = "请输入砍价金额"
    )
    @DecimalMin(
            value = "0.00",
            message = "砍价金额不在合法范围内"
    )
    @DecimalMax(
            value = "99999999.99",
            message = "砍价金额不在合法范围内"
    )
    @ApiModelProperty("砍价产品砍价金额")
    private BigDecimal price;
    @NotNull(
            message = "请输入砍到最低价"
    )
    @DecimalMin(
            value = "0.00",
            message = "砍到最低价不在合法范围内"
    )
    @DecimalMax(
            value = "99999999.99",
            message = "砍到最低价不在合法范围内"
    )
    @ApiModelProperty("砍价商品最低价")
    private BigDecimal minPrice;
    @NotNull(
            message = "请输入限购数量"
    )
    @Min(
            message = "限购不能小于0",
            value = 1L
    )
    @ApiModelProperty("每次购买的砍价产品数量")
    private Integer num;
    @NotNull(
            message = "请输入单次砍最高价"
    )
    @DecimalMin(
            value = "0.00",
            message = "单次砍最高价不在合法范围内"
    )
    @DecimalMax(
            value = "99999999.99",
            message = "单次砍最高价不在合法范围内"
    )
    @ApiModelProperty("用户每次砍价的最大金额")
    private BigDecimal bargainMaxPrice;
    @NotNull(
            message = "请输入单次砍最低价"
    )
    @DecimalMin(
            value = "0.00",
            message = "单次砍最低价不在合法范围内"
    )
    @DecimalMax(
            value = "99999999.99",
            message = "单次砍最低价小金额不在合法范围内"
    )
    @ApiModelProperty("用户每次砍价的最小金额")
    private BigDecimal bargainMinPrice;
    @NotNull(
            message = "请输入砍价的次数"
    )
    @Min(
            message = "砍价的次数不能小于0",
            value = 1L
    )
    @ApiModelProperty("用户每次砍价的次数")
    private Integer bargainNum;
    @ApiModelProperty("砍价状态 0(到砍价时间不自动开启)  1(到砍价时间自动开启时间)")
    private Integer status;
    @NotBlank(
            message = "请填写详情"
    )
    @ApiModelProperty("砍价详情")
    private String description;
    @ApiModelProperty("返多少积分")
    private BigDecimal giveIntegral;
    @ApiModelProperty("砍价产品简介")
    private String info;
    @ApiModelProperty("成本价")
    private BigDecimal cost;
    @ApiModelProperty("排序")
    private Integer sort;
    @ApiModelProperty("是否推荐0不推荐1推荐")
    private Integer isHot;
    @ApiModelProperty("是否包邮 0不包邮 1包邮")
    private Integer isPostage;
    @ApiModelProperty("邮费")
    private BigDecimal postage;
    @NotBlank(
            message = "请填写砍价规则"
    )
    @ApiModelProperty("砍价规则描述")
    private String rule;
    @ApiModelProperty("砍价产品浏览量")
    private Integer look;
    @ApiModelProperty("砍价产品分享量")
    private Integer share;

    public void copy(StoreBargain source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public StoreBargain() {
    }

    public Long getId() {
        return this.id;
    }

    public Long getProductId() {
        return this.productId;
    }

    public String getTitle() {
        return this.title;
    }

    public String getImage() {
        return this.image;
    }

    public String getUnitName() {
        return this.unitName;
    }

    public Integer getStock() {
        return this.stock;
    }

    public Integer getSales() {
        return this.sales;
    }

    public String getImages() {
        return this.images;
    }

    public Date getStartTime() {
        return this.startTime;
    }

    public Date getStopTime() {
        return this.stopTime;
    }

    public String getStoreName() {
        return this.storeName;
    }

    public BigDecimal getPrice() {
        return this.price;
    }

    public BigDecimal getMinPrice() {
        return this.minPrice;
    }

    public Integer getNum() {
        return this.num;
    }

    public BigDecimal getBargainMaxPrice() {
        return this.bargainMaxPrice;
    }

    public BigDecimal getBargainMinPrice() {
        return this.bargainMinPrice;
    }

    public Integer getBargainNum() {
        return this.bargainNum;
    }

    public Integer getStatus() {
        return this.status;
    }

    public String getDescription() {
        return this.description;
    }

    public BigDecimal getGiveIntegral() {
        return this.giveIntegral;
    }

    public String getInfo() {
        return this.info;
    }

    public BigDecimal getCost() {
        return this.cost;
    }

    public Integer getSort() {
        return this.sort;
    }

    public Integer getIsHot() {
        return this.isHot;
    }

    public Integer getIsPostage() {
        return this.isPostage;
    }

    public BigDecimal getPostage() {
        return this.postage;
    }

    public String getRule() {
        return this.rule;
    }

    public Integer getLook() {
        return this.look;
    }

    public Integer getShare() {
        return this.share;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public void setProductId(final Long productId) {
        this.productId = productId;
    }

    public void setTitle(final String title) {
        this.title = title;
    }

    public void setImage(final String image) {
        this.image = image;
    }

    public void setUnitName(final String unitName) {
        this.unitName = unitName;
    }

    public void setStock(final Integer stock) {
        this.stock = stock;
    }

    public void setSales(final Integer sales) {
        this.sales = sales;
    }

    public void setImages(final String images) {
        this.images = images;
    }

    public void setStartTime(final Date startTime) {
        this.startTime = startTime;
    }

    public void setStopTime(final Date stopTime) {
        this.stopTime = stopTime;
    }

    public void setStoreName(final String storeName) {
        this.storeName = storeName;
    }

    public void setPrice(final BigDecimal price) {
        this.price = price;
    }

    public void setMinPrice(final BigDecimal minPrice) {
        this.minPrice = minPrice;
    }

    public void setNum(final Integer num) {
        this.num = num;
    }

    public void setBargainMaxPrice(final BigDecimal bargainMaxPrice) {
        this.bargainMaxPrice = bargainMaxPrice;
    }

    public void setBargainMinPrice(final BigDecimal bargainMinPrice) {
        this.bargainMinPrice = bargainMinPrice;
    }

    public void setBargainNum(final Integer bargainNum) {
        this.bargainNum = bargainNum;
    }

    public void setStatus(final Integer status) {
        this.status = status;
    }

    public void setDescription(final String description) {
        this.description = description;
    }

    public void setGiveIntegral(final BigDecimal giveIntegral) {
        this.giveIntegral = giveIntegral;
    }

    public void setInfo(final String info) {
        this.info = info;
    }

    public void setCost(final BigDecimal cost) {
        this.cost = cost;
    }

    public void setSort(final Integer sort) {
        this.sort = sort;
    }

    public void setIsHot(final Integer isHot) {
        this.isHot = isHot;
    }

    public void setIsPostage(final Integer isPostage) {
        this.isPostage = isPostage;
    }

    public void setPostage(final BigDecimal postage) {
        this.postage = postage;
    }

    public void setRule(final String rule) {
        this.rule = rule;
    }

    public void setLook(final Integer look) {
        this.look = look;
    }

    public void setShare(final Integer share) {
        this.share = share;
    }

    public String toString() {
        return "StoreBargain(id=" + this.getId() + ", productId=" + this.getProductId() + ", title=" + this.getTitle() + ", image=" + this.getImage() + ", unitName=" + this.getUnitName() + ", stock=" + this.getStock() + ", sales=" + this.getSales() + ", images=" + this.getImages() + ", startTime=" + this.getStartTime() + ", stopTime=" + this.getStopTime() + ", storeName=" + this.getStoreName() + ", price=" + this.getPrice() + ", minPrice=" + this.getMinPrice() + ", num=" + this.getNum() + ", bargainMaxPrice=" + this.getBargainMaxPrice() + ", bargainMinPrice=" + this.getBargainMinPrice() + ", bargainNum=" + this.getBargainNum() + ", status=" + this.getStatus() + ", description=" + this.getDescription() + ", giveIntegral=" + this.getGiveIntegral() + ", info=" + this.getInfo() + ", cost=" + this.getCost() + ", sort=" + this.getSort() + ", isHot=" + this.getIsHot() + ", isPostage=" + this.getIsPostage() + ", postage=" + this.getPostage() + ", rule=" + this.getRule() + ", look=" + this.getLook() + ", share=" + this.getShare() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof StoreBargain)) {
            return false;
        } else {
            StoreBargain other = (StoreBargain)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (!super.equals(o)) {
                return false;
            } else {
                label361: {
                    Object this$id = this.getId();
                    Object other$id = other.getId();
                    if (this$id == null) {
                        if (other$id == null) {
                            break label361;
                        }
                    } else if (this$id.equals(other$id)) {
                        break label361;
                    }

                    return false;
                }

                Object this$productId = this.getProductId();
                Object other$productId = other.getProductId();
                if (this$productId == null) {
                    if (other$productId != null) {
                        return false;
                    }
                } else if (!this$productId.equals(other$productId)) {
                    return false;
                }

                label347: {
                    Object this$stock = this.getStock();
                    Object other$stock = other.getStock();
                    if (this$stock == null) {
                        if (other$stock == null) {
                            break label347;
                        }
                    } else if (this$stock.equals(other$stock)) {
                        break label347;
                    }

                    return false;
                }

                Object this$sales = this.getSales();
                Object other$sales = other.getSales();
                if (this$sales == null) {
                    if (other$sales != null) {
                        return false;
                    }
                } else if (!this$sales.equals(other$sales)) {
                    return false;
                }

                Object this$num = this.getNum();
                Object other$num = other.getNum();
                if (this$num == null) {
                    if (other$num != null) {
                        return false;
                    }
                } else if (!this$num.equals(other$num)) {
                    return false;
                }

                label326: {
                    Object this$bargainNum = this.getBargainNum();
                    Object other$bargainNum = other.getBargainNum();
                    if (this$bargainNum == null) {
                        if (other$bargainNum == null) {
                            break label326;
                        }
                    } else if (this$bargainNum.equals(other$bargainNum)) {
                        break label326;
                    }

                    return false;
                }

                label319: {
                    Object this$status = this.getStatus();
                    Object other$status = other.getStatus();
                    if (this$status == null) {
                        if (other$status == null) {
                            break label319;
                        }
                    } else if (this$status.equals(other$status)) {
                        break label319;
                    }

                    return false;
                }

                Object this$sort = this.getSort();
                Object other$sort = other.getSort();
                if (this$sort == null) {
                    if (other$sort != null) {
                        return false;
                    }
                } else if (!this$sort.equals(other$sort)) {
                    return false;
                }

                Object this$isHot = this.getIsHot();
                Object other$isHot = other.getIsHot();
                if (this$isHot == null) {
                    if (other$isHot != null) {
                        return false;
                    }
                } else if (!this$isHot.equals(other$isHot)) {
                    return false;
                }

                label298: {
                    Object this$isPostage = this.getIsPostage();
                    Object other$isPostage = other.getIsPostage();
                    if (this$isPostage == null) {
                        if (other$isPostage == null) {
                            break label298;
                        }
                    } else if (this$isPostage.equals(other$isPostage)) {
                        break label298;
                    }

                    return false;
                }

                label291: {
                    Object this$look = this.getLook();
                    Object other$look = other.getLook();
                    if (this$look == null) {
                        if (other$look == null) {
                            break label291;
                        }
                    } else if (this$look.equals(other$look)) {
                        break label291;
                    }

                    return false;
                }

                Object this$share = this.getShare();
                Object other$share = other.getShare();
                if (this$share == null) {
                    if (other$share != null) {
                        return false;
                    }
                } else if (!this$share.equals(other$share)) {
                    return false;
                }

                Object this$title = this.getTitle();
                Object other$title = other.getTitle();
                if (this$title == null) {
                    if (other$title != null) {
                        return false;
                    }
                } else if (!this$title.equals(other$title)) {
                    return false;
                }

                label270: {
                    Object this$image = this.getImage();
                    Object other$image = other.getImage();
                    if (this$image == null) {
                        if (other$image == null) {
                            break label270;
                        }
                    } else if (this$image.equals(other$image)) {
                        break label270;
                    }

                    return false;
                }

                label263: {
                    Object this$unitName = this.getUnitName();
                    Object other$unitName = other.getUnitName();
                    if (this$unitName == null) {
                        if (other$unitName == null) {
                            break label263;
                        }
                    } else if (this$unitName.equals(other$unitName)) {
                        break label263;
                    }

                    return false;
                }

                Object this$images = this.getImages();
                Object other$images = other.getImages();
                if (this$images == null) {
                    if (other$images != null) {
                        return false;
                    }
                } else if (!this$images.equals(other$images)) {
                    return false;
                }

                label249: {
                    Object this$startTime = this.getStartTime();
                    Object other$startTime = other.getStartTime();
                    if (this$startTime == null) {
                        if (other$startTime == null) {
                            break label249;
                        }
                    } else if (this$startTime.equals(other$startTime)) {
                        break label249;
                    }

                    return false;
                }

                Object this$stopTime = this.getStopTime();
                Object other$stopTime = other.getStopTime();
                if (this$stopTime == null) {
                    if (other$stopTime != null) {
                        return false;
                    }
                } else if (!this$stopTime.equals(other$stopTime)) {
                    return false;
                }

                label235: {
                    Object this$storeName = this.getStoreName();
                    Object other$storeName = other.getStoreName();
                    if (this$storeName == null) {
                        if (other$storeName == null) {
                            break label235;
                        }
                    } else if (this$storeName.equals(other$storeName)) {
                        break label235;
                    }

                    return false;
                }

                Object this$price = this.getPrice();
                Object other$price = other.getPrice();
                if (this$price == null) {
                    if (other$price != null) {
                        return false;
                    }
                } else if (!this$price.equals(other$price)) {
                    return false;
                }

                Object this$minPrice = this.getMinPrice();
                Object other$minPrice = other.getMinPrice();
                if (this$minPrice == null) {
                    if (other$minPrice != null) {
                        return false;
                    }
                } else if (!this$minPrice.equals(other$minPrice)) {
                    return false;
                }

                label214: {
                    Object this$bargainMaxPrice = this.getBargainMaxPrice();
                    Object other$bargainMaxPrice = other.getBargainMaxPrice();
                    if (this$bargainMaxPrice == null) {
                        if (other$bargainMaxPrice == null) {
                            break label214;
                        }
                    } else if (this$bargainMaxPrice.equals(other$bargainMaxPrice)) {
                        break label214;
                    }

                    return false;
                }

                label207: {
                    Object this$bargainMinPrice = this.getBargainMinPrice();
                    Object other$bargainMinPrice = other.getBargainMinPrice();
                    if (this$bargainMinPrice == null) {
                        if (other$bargainMinPrice == null) {
                            break label207;
                        }
                    } else if (this$bargainMinPrice.equals(other$bargainMinPrice)) {
                        break label207;
                    }

                    return false;
                }

                Object this$description = this.getDescription();
                Object other$description = other.getDescription();
                if (this$description == null) {
                    if (other$description != null) {
                        return false;
                    }
                } else if (!this$description.equals(other$description)) {
                    return false;
                }

                Object this$giveIntegral = this.getGiveIntegral();
                Object other$giveIntegral = other.getGiveIntegral();
                if (this$giveIntegral == null) {
                    if (other$giveIntegral != null) {
                        return false;
                    }
                } else if (!this$giveIntegral.equals(other$giveIntegral)) {
                    return false;
                }

                label186: {
                    Object this$info = this.getInfo();
                    Object other$info = other.getInfo();
                    if (this$info == null) {
                        if (other$info == null) {
                            break label186;
                        }
                    } else if (this$info.equals(other$info)) {
                        break label186;
                    }

                    return false;
                }

                label179: {
                    Object this$cost = this.getCost();
                    Object other$cost = other.getCost();
                    if (this$cost == null) {
                        if (other$cost == null) {
                            break label179;
                        }
                    } else if (this$cost.equals(other$cost)) {
                        break label179;
                    }

                    return false;
                }

                Object this$postage = this.getPostage();
                Object other$postage = other.getPostage();
                if (this$postage == null) {
                    if (other$postage != null) {
                        return false;
                    }
                } else if (!this$postage.equals(other$postage)) {
                    return false;
                }

                Object this$rule = this.getRule();
                Object other$rule = other.getRule();
                if (this$rule == null) {
                    if (other$rule != null) {
                        return false;
                    }
                } else if (!this$rule.equals(other$rule)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof StoreBargain;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = super.hashCode();
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $productId = this.getProductId();
        result = result * 59 + ($productId == null ? 43 : $productId.hashCode());
        Object $stock = this.getStock();
        result = result * 59 + ($stock == null ? 43 : $stock.hashCode());
        Object $sales = this.getSales();
        result = result * 59 + ($sales == null ? 43 : $sales.hashCode());
        Object $num = this.getNum();
        result = result * 59 + ($num == null ? 43 : $num.hashCode());
        Object $bargainNum = this.getBargainNum();
        result = result * 59 + ($bargainNum == null ? 43 : $bargainNum.hashCode());
        Object $status = this.getStatus();
        result = result * 59 + ($status == null ? 43 : $status.hashCode());
        Object $sort = this.getSort();
        result = result * 59 + ($sort == null ? 43 : $sort.hashCode());
        Object $isHot = this.getIsHot();
        result = result * 59 + ($isHot == null ? 43 : $isHot.hashCode());
        Object $isPostage = this.getIsPostage();
        result = result * 59 + ($isPostage == null ? 43 : $isPostage.hashCode());
        Object $look = this.getLook();
        result = result * 59 + ($look == null ? 43 : $look.hashCode());
        Object $share = this.getShare();
        result = result * 59 + ($share == null ? 43 : $share.hashCode());
        Object $title = this.getTitle();
        result = result * 59 + ($title == null ? 43 : $title.hashCode());
        Object $image = this.getImage();
        result = result * 59 + ($image == null ? 43 : $image.hashCode());
        Object $unitName = this.getUnitName();
        result = result * 59 + ($unitName == null ? 43 : $unitName.hashCode());
        Object $images = this.getImages();
        result = result * 59 + ($images == null ? 43 : $images.hashCode());
        Object $startTime = this.getStartTime();
        result = result * 59 + ($startTime == null ? 43 : $startTime.hashCode());
        Object $stopTime = this.getStopTime();
        result = result * 59 + ($stopTime == null ? 43 : $stopTime.hashCode());
        Object $storeName = this.getStoreName();
        result = result * 59 + ($storeName == null ? 43 : $storeName.hashCode());
        Object $price = this.getPrice();
        result = result * 59 + ($price == null ? 43 : $price.hashCode());
        Object $minPrice = this.getMinPrice();
        result = result * 59 + ($minPrice == null ? 43 : $minPrice.hashCode());
        Object $bargainMaxPrice = this.getBargainMaxPrice();
        result = result * 59 + ($bargainMaxPrice == null ? 43 : $bargainMaxPrice.hashCode());
        Object $bargainMinPrice = this.getBargainMinPrice();
        result = result * 59 + ($bargainMinPrice == null ? 43 : $bargainMinPrice.hashCode());
        Object $description = this.getDescription();
        result = result * 59 + ($description == null ? 43 : $description.hashCode());
        Object $giveIntegral = this.getGiveIntegral();
        result = result * 59 + ($giveIntegral == null ? 43 : $giveIntegral.hashCode());
        Object $info = this.getInfo();
        result = result * 59 + ($info == null ? 43 : $info.hashCode());
        Object $cost = this.getCost();
        result = result * 59 + ($cost == null ? 43 : $cost.hashCode());
        Object $postage = this.getPostage();
        result = result * 59 + ($postage == null ? 43 : $postage.hashCode());
        Object $rule = this.getRule();
        result = result * 59 + ($rule == null ? 43 : $rule.hashCode());
        return result;
    }
}

